# -*-coding:utf-8-*-
__author__ = "zhl"

import pandas as pd
def dict_convert_dataframe_tocsv(file,dict,label,df):
    """
    dict->dataFrame->csv
    """
    for k,v in dict.items():
        data = [v]  
        df = df.append(pd.DataFrame(data,index=[k],columns=label))
        df.to_csv(file,mode="a",header=False)
    return df

def dict_convert_dataframe(dict,label,df):
    """
    dict->dataFrame
    """
    for k,v in dict.items():
        data = [v]  
        df = df.append(pd.DataFrame(data,index=[k],columns=label))
    return df


if __name__=="__main__":
    pass
